***Plos ONE: Joy leads to overconfidence, and a simple countermeasure
*Pretest

*Table 1.
reg oc Treat_NEUTRAL gender age age2 i.stakes studysub p if ocdirect==1 
reg  oc Treat_NEUTRAL if ocdirect==1

reg roca Treat_NEUTRAL gender age age2 i.stakes studysub p if ocdirect==1 
reg  roca Treat_NEUTRAL if ocdirect==1 

*Descriptive results
tabstat age gender if ocdirect==1, stat (mean semean min max)

tab gender if ocdirect==1
tab stakes if ocdirect==1
tab Treat_JOY if ocdirect==1
tab Treat_NEUTRAL if ocdirect==1

pca aHAPPY aJOYFUL aDELIGHTED aCHEERFUL aEXCITED aENTHUSIASTIC aLIVELY aENERGETIC aAFRAID aSCARED aFRIGHTENED aNERVOUS aJITTERY aSHAKY aSAD aBLUE aDOWNHEARTED aALONE aLONELY
rotate, ortho
predict Comp1 Comp2 Comp3 Comp4

tabstat  Joy_a if ocdirect==1 & Treat_JOY ==1, stat (mean semean)
tabstat  Joy_a if ocdirect==1 & Treat_NEUTRAL ==1, stat (mean semean)

gen Treat_JoyNeutral = .
replace Treat_JoyNeutral = 1 if Treat_JOY == 1
replace Treat_JoyNeutral = 0 if Treat_NEUTRAL == 1
tab Treat_JoyNeutral if ocdirect==1 
ttest Joy_a if ocdirect==1, by(Treat_JoyNeutral)

pwcorr Joy_a joy_a_neu A_JOY


tabstat no_rightQuiz if ocdirect==1, stats (mean semean median min max)
tab no_rightQuiz if ocdirect==1

ttest no_rightQuiz if ocdirect==1, by(Treat_JoyNeutral)
robvar no_rightQuiz if ocdirect==1, by(Treat_JoyNeutral) 

tabstat oc roca if ocdirect==1 & Treat_JOY == 1, stats (mean semean)
tabstat oc roca if ocdirect==1 & Treat_NEUTRAL == 1, stats (mean semean)

ttest oc if ocdirect==1, by(Treat_JoyNeutral)
ttest roca if ocdirect==1, by(Treat_JoyNeutral)

ttest oc == 0 if ocdirect==1 & Treat_NEUTRAL ==1
ttest roca == 0 if ocdirect== & Treat_NEUTRAL ==1

pwcorr oc roca Treat_JOY Treat_NEUTRAL gender age Student EmployeePart EmployeeFull SelfPart SelfFull Unemployed houswife other education risks FExtraversion FEmotStab FConscientious FAgreeable Extraversion Agreeableness Conscientiousness EmotionalStability Openness seenBefore no_rightQuiz if ocdirect==1  & Treat_SAD==0 & Treat_FEAR==0, sig star(.05)



